public class Demo6 {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("beg: "+System.currentTimeMillis());//获取当前系统时间到毫秒级的时间戳
        Thread.sleep(1000);
        System.out.println("end: "+System.currentTimeMillis());//实际存在误差
    }
}
